<?php
if(!defined('IN_ADMIN')) {
	exit('Acess Denied');
}

if(submitcheck('verify')) {
	if(!empty($_POST['verifyname'])){
		foreach($_POST['verifyname'] as $id=>$name) {
			DB::query("UPDATE ".DB::table('verify')." SET `name`='$name', `img`='".$_POST['verifyimg'][$id]."' WHERE id=$id");
		}
	}
	cpmsg('update_success', '?action=verify');
}
shownav('global', 'nav_verify');
showsubmenu('nav_verify');
showformheader('verify');
showtableheader('');
showsubtitle(array('', 'verify_name', 'verify_img'));

$query = DB::query("SELECT * FROM ".DB::table('verify'));
while($value = DB::fetch($query)) {
	$rowitem = array();
	$rowitem[] = $value['verify'];
	$rowitem[] = '<input name="verifyname['.$value['id'].']" type="text" size="8" value="'.$value['name'].'" />';
	$rowitem[] = '<input name="verifyimg['.$value['id'].']" type="text" size="8" value="'.$value['img'].'" /> &nbsp; <img src="static/image/'.$value['img'].'">';
	showtablerow('', array(), $rowitem);
}

showsubmit('verify');
showtablefooter();
showformfooter();
bind_ajax_form();
?>
